package com.atguigu.springcloud.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @ClassName ApplicationContextConfig
 * @Description 注册RestTemplateBean
 * @Author 周轩霆
 * @Date 2022/9/27 14:06
 **/
@Configuration

public class ApplicationContextConfig {
    @Bean
    //开启负载均衡
    //默认是轮询 你一次我一次
    @LoadBalanced
    public RestTemplate getRestTemplate(){
        return new RestTemplate();
    }
}
